package hb.software.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import domain.BaseTreeEntity;
import hb.software.entity.Course;
@Entity
@Table(name="T_CourseCategory")
@NamedQueries({ @NamedQuery(name = "CourseCategory.getRoot", query = "select g from CourseCategory g where g.parent is null") })
public class CourseCategory extends BaseTreeEntity<CourseCategory,Long> {

	/**
	 * 
	 */
	@Column
	String code;

	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * name for product category
	 */
	@Column
	String name;
	private static final long serialVersionUID = -7289566538018581683L;
	@OneToMany(mappedBy = "courseCategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<Course>courses;
}
